package com.myList{
	import com.bases.TLable;
	import com.bases.TUIComponent;
	import com.Interface.IItem;
	import com.skin.SkinManage;
	
	import flash.display.MovieClip;
	import flash.events.Event;
	import flash.events.MouseEvent;
	
	public class CompanyItem extends TUIComponent implements IItem{
		private var label:TLable;
		private var myData:MyData;
		private var bg:MovieClip;
		
		public function CompanyItem() {
			super();
			
			bg = SkinManage.getInstance().getMovieClip("crm_item");
			this.addChild(bg);
			
			this.relayout();
			this.addEventListener(MouseEvent.CLICK,handler);
		}
		
		override protected function relayout():void{
			super.relayout();
		}
		
		private function handler(e:MouseEvent):void{
			this.dispatchEvent(new Event("ItemClick",true));
		}
		
		public function set userData(value:*):void {
			myData=value;
			bg.txt.text = myData.label;
		}
		
		public function get userData():* {
			return myData;
		}
	}
}